home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / asppw112 / deletedi.asp < prev    next >
Text File  |  1999-01-07  |  1KB  |  49 lines

  1. <HTML><BODY>
  2. <%
  3.     ' Method: DeleteDir(strDirPathName)
  4.     '
  5.     ' Delete directory "sample" and its all files and directories.
  6.     '
  7.     ' This file is provided as part of  ASP Power Widgets Samples
  8.     '
  9.     ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
  10.     ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  11.     ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  12.     ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
  13.     ' PURPOSE.
  14.  
  15.     ' Copyright 1997-1998. All rights reserved.
  16.     ' Dalun Software Inc. ASP Power Widgets
  17.     ' http://www.dalun.com
  18.     ' http://members.tripod.com/ActiveServerPage/
  19.  
  20.     sDir   = "sample"
  21.     sDirPathName   = Server.MapPath("/") & "\" & sDir
  22.  
  23.     response.write "Directory """  & sDirPathName  & _
  24.            """ to be deleted.<br>"
  25.  
  26.     Set oFDMgt   = Server.CreateObject("ASPPW.FDMgt")
  27.     iReturnCode  = oFDMgt.DeleteDir (sDirPathName)
  28.  
  29.     select case iReturnCode
  30.         case    1:  response.write "Operation succeeds. <br>"
  31.         case    0:  response.write "Operation failed since """ & sDirPathName & """ is not found."
  32.         case   -1:  response.write "Operation failed."
  33.         case else:
  34.     end select
  35.  
  36.     if oFDMgt.GetLastErrNum <> 0 then
  37.         response.write  oFDMgt.GetLastErrDescription
  38.     end if
  39.  
  40.     Set oFDMgt   = nothing
  41.      
  42. %>
  43. </BODY></HTML>
  44.  
  45.  
  46.  
  47.  
  48.  
  49.